<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="he_includePackage.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>


<body>
	<style>
.col-xs-3 {
	padding: 1px;
	height: 1225px;
}

.col-xs-9 {
	height: 1225px;
}

.container {
	width: 1280px !important;
}

.xs11 {
	margin-top: 20px;
	margin-left: 30px;
}

#xs12 {
	height: 1119px;
	width: 313px;
}

#xs11 {
	height: 140px;
}

#xs1 {
	height: 100px;
	width: 80px;
}

body {
	font-size: 12px;
}

ul {
	margin: 0;
	padding: 7px;
}

ul li {
	height: 22px;
	vertical-align: bottom;
}

.actived {
	height: 40px;
	border-top: 3px solid #ff9900;;
	border-right: 1px solid #AAC7E9;
	border-left: 1px solid #AAC7E9;
	border-bottom: 1px solid #AAC7E9;
	background: #FFDAB9;
}

.panel-group {
	padding: 1px;
	margin：1px;
}

td {
	text-align: center;
}

th {
	text-align: center;
}

nav {
	text-align: center;
}
</style>
	<script type="text/javascript" language="javascript">
	var source_formatter;
 $(function(){//处理来源的格式
	$.ajax({
		url:'${pageContext.request.contextPath}/thesissource',
    	type:'post',
    	dataTye:'json',
    	success:function(j){
				source_formatter=j;
    		} 
		 });
}) ;
	var TEMD;
	var dissId;
	$(function() {
		TEMD = $('#teacherExamManuscriptDatagrid')
				.datagrid(
						{
							url:'<%=request.getContextPath()%>/getTEMDInfo',
							pagination : true,
							singleSelect : true,
							sortName : 'dissName',
							sortOrder : 'asc',
							fit : true,
							fitColumns : true,
							columns : [ [
									{
										field:'box',
										checkbox:true
									},
									{
										field : 'dissName',
										title : '论文名',
										width : 200,
										sortable : true,
									},
									{
										field : 'dissType',
										title : '论文类型',
										width : 50
									},
									{
										field : 'dissSrc',
										title : '来源',
										width : 100,
										 formatter: function(value,row,index){
					for(var i in source_formatter){
						if(source_formatter[i].thesissource_id==value){
							res=source_formatter[i].thesissource_name;
						}
					}
			        return res;
				}, 
									},
									{
										field : 'StudentId',
										title : '学生学号',
										width : 100
									},
									{
										field : 'StudentName',
										title : '学生名',
										width : 100
									},
									{
										field : 'dissStateOfExamination',
										title : '初稿状态',
										width : 150,
										formatter: function(value,row,index){
										if (value=='A'){
						return '待审核';
					} ;
					if(value=='B'){
						return '已通过';
					};
					if(value=='C'){
						return '不通过';
					};
				},
									},
									{
										field : 'btn',
										title : '下载',
										width : 50,
										formatter : function(value, row, index) {
											return '<a id="'+index+'"><button type="button" class="btn btn-primary btn-xs"  onclick="down('+index+')">下载</button></a>';
											//return	'<button type="button" class="btn btn-primary btn-xs"  disabled="disabled" onclick="down('+index+')">下载</button>';
									}
									},
									{
										field : 'btn2',
										title : '审核操作',
										width : 100,
										formatter : function(value, row, index) {
										if(row.dissStateOfExamination=="A"||row.dissStateOfExamination==null||row.dissStateOfExamination=="")
											return	'<button type="button" class="btn btn-success btn-xs"  onclick="pass('+row.id+')">通过</button>'+             
                    								'<a data-toggle="collapse" data-parent="#accordion" href="#collapseZDYJ">'+
                   									'<button type="button" class="btn btn-danger btn-xs"   onclick="choose('+row.id+')">不通过</button>';
                   						else
                   							return	'<button type="button" class="btn btn-error btn-xs" disabled="disabled" onclick="pass('+row.id+')">通过</button>'+ 
                   									'<button type="button" class="btn btn-error btn-xs"  disabled="disabled" onclick="choose('+row.id+')">不通过</button>';
									}
									} ] ],
									onClickRow :function(rowIndex, rowData){
										console.info(rowData.id);
										document.getElementById("hiddenId").value=rowData.id;
										console.info(document.getElementById("hiddenId").value);
									}
						});
		down = function(i) {
			console.info(i);
			var rows=TEMD.datagrid('getRows');
			console.info(rows);
			console.info("<%=basePath%>downLoad?URL="
					+ rows[i].dissManuscriptURL);
			document.getElementById(i).href = "<%=basePath%>downLoad?URL="
					+ rows[i].dissManuscriptURL+"&type=8";
		},
		pass =function(i)
		{
			$.ajax({
			url : '<%=request.getContextPath()%>/FDPass',
				data : {
					'id' : i,
				},
				dataType : 'json',
				success : function(r) {
					document.location.reload();
				},
				error : function(r) {
					$.messager.alert('Warning', "请选择学生");
				}
			});
		},
		choose=function(i)
		{
			dissId=i;
		},
		sendMsg=function()
		{
			$.ajax({
			url : '<%=request.getContextPath()%>/FDSetMsg',
					data : {
						'id' : dissId,
						'msg' : document.getElementById("FDComment").value,
					},
					dataType : 'json',
					success : function(r) {
						document.location.reload();
					},
					error : function(r) {
						$.messager.alert('Warning', "请选择学生");
					}
				});
			}
		});
	</script>
	
	<div class="row">
		<div class="col-xs-12  xs11">
			<strong><font size="3">流程管理》审核论文初稿</font> </strong>
		</div>
	</div>
	<div class="row">
		<div class="col-xs-11  xs11">
			<div class="panel panel-default">
				<div class="panel-heading" align="left">
					<a data-toggle="collapse" data-parent="#accordion"
						href="#collapseHelp" class="glyphicon glyphicon-chevron-down">
						操作指南 </a>
				</div>
				<div id="collapseHelp" class="panel-collapse collapse">
					<div class="panel-body">
						&nbsp;&nbsp;论文初稿由两部分组成，其中设计（论文）必须上传，附件根据部分导师要求选择上传：
						<ul>
							<li>论文初稿必须按照论文模板要求，完成论文的封页、中英文摘要、目录、正文、结论、参考文献部分。</li>
							<li>所有格式与正式论文要求相同只是内容的部分需要指导教师的审阅。</li>
							<li>论文初稿经过指导教师审核、修改、最后通过审核后，学生需要再次提交论文正稿作为论文知网查重检测的论文模板。</li>
							<li>提交的论文名称： 学号+学生姓名.doc 。</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-xs-11 xs11">
			<p>
				<b><font size="3">毕业设计流转状态：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;审核论文初稿





				
			</p>
			</b></font>
		</div>
	</div>
	<br>
	<div style="width:100%;height:300px;">
		<table id="teacherExamManuscriptDatagrid"></table>
	</div>
	<div class="row">
							<div class="col-xs-12" align="center">
							<form action="<%=request.getContextPath()%>/FDRetrunRevision" method="post" enctype="multipart/form-data" >   
								<input type="hidden" id="hiddenId" name="hiddenId">
								<table class="table table-bordered">
									<br>
									<b> <font size="3">论文定稿反馈提交</font> </b>   
									<tbody>
										<tr>
											<td class="info" style="width:25%"><p align="center" ><div>
													<b>论文定稿反馈文件上传:</b></div>
												</p> 
											</td>
											<td ><div style="border:3px solid #25465d ; background-color:#d8d8d8;">
													<div class="form-group">
														<label class="sr-only" for="inputfile">文件输入</label> <input
															type="file" name="filename">
													</div>
												</div>
											</td>
										</tr>

										<tr>
											<td class="info"><p align="left">
													<b><p>注释：</p> </b>
											</td>
											<td>论文定稿要求按照标准模板撰写完成，其中包括开题报告，封面，中英文摘要，目录，正文，参考文献等。上传格式建议采用word格式，便于教师修改。</td>
										</tr>
									</tbody>
								</table>
								<td align="center"><button type="submit"
										class="btn btn-success btn-bg" />提交
									</button>
								</td>
								</form>  
								<div class="row" align="center">
									<div class="col-xs-11  xs11">
										<div class="panel panel-default">
											<div class="panel-heading" align="left"
												style="color:#4682B4;">教师指导意见</div>
											<div id="collapseZDYJ" class="panel-collapse collapse">
												<div class="panel-body">
													<textarea class="form-control" rows="3" id="FDComment"
														placeholder="指导教师论文初稿指导意见："></textarea>
													<br> <br>
													<button type="button" class="btn btn-success btn-bg"
														name="" onclick="sendMsg() "
														value="刷新" />
													提交
													</button>
													&nbsp;&nbsp;&nbsp; <a data-toggle="collapse"
														data-parent="#accordion" href="#collapseZDYJ">
														<button type="button" class="btn btn-danger btn-bg"
															name="">返回</button> </a>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<!--修改结束-->
						</div>
</body>
</html>
